<?php
namespace app\common\validate\Subject;

use think\Validate;

// 课程分类的验证器
class Category extends Validate
{
    protected $rule =   [
        'name'  => ['require','unique:subject_category'],
        'weight' => ['require','egt:0']
    ];

    protected $message  =   [
        'name.require' => '课程分类名称必须填写',
        'name.unique' => '该课程分类已存在',
        'weight.require' => '课程分类权重必须填写',
        'weight.egt' => '课程分类权重必须大于0'
    ];

    protected $scene = [

    ];
}